<?php
class Mozg_Source
{
	private static $_sources = array();
	
	private function __construct(){}
	
	public static function get($sourceName)
	{
		if (!self::$_sources[$sourceName])
		{
			self::$_sources[$sourceName] = self::load($sourceName);
		}
			
		return self::$_sources[$sourceName];
	}
	
	private static function load($sourceName)
	{
		$sourceClassName = 'App_SourceType_' .$sourceName;
		return new $sourceClassName();		
	}
}